package com.epam.task.oop.medicines;

import java.util.ArrayList;
import java.util.List;

public class Recipe {
    private static int recipeSumm;
    private List<PharmacyProducts> product = new ArrayList<PharmacyProducts>();

    public static void incTotals(int count, float price) {
        recipeSumm += count * price;
    }

    public String findByPrice(int min, int max) {
        String res = "\n";
        for (PharmacyProducts pp : product) {
            if (pp.getPrice() >= min
                    && pp.getPrice() <= max)
                res += pp.getName() + " price "
                        + pp.getPrice() + " tenge\n";
        }
        return res;
    }

    public String listAllPharmacyProducts() {
        String res = "";
        for (PharmacyProducts pp : product) {
            res += pp.toString() + "\n";
        }
        return res;
    }

    public String printTotals() {
        String res = "The total summ is: " + recipeSumm;
        return res;
    }

    public List<PharmacyProducts> getProduct() {
        return product;
    }

    public int getRecipeSumm() {
        return recipeSumm;
    }
}
